package Utils;

import java.sql.*;

public class DBUtil {

    public static Connection openConnection() {

        Connection conn = null;

        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/softwareDesign?useUnicode=true" +
                    "&characterEncoding=utf-8&useSSL=false", "root", "Dempsey33@");
        } catch (Exception e) {
            e.printStackTrace();
        }

        return conn;
    }


    public static void closeConn(Connection conn) {
        if (conn != null) {
            try {
                conn.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

}
